/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.model.entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author TNT
 */
@Entity
public class Item implements Serializable {

    @Id
    @GeneratedValue
    private int itemId;
    @Column(length = 50, nullable = false)
    private String name;
    @Column(length = 5, nullable = false, unique = true)
    private String code;
    @Column(length = 5, unique = true)
    private String otherCode;
    @Column(nullable = false)
    private int totalPage;
    private Date publishDate;
    private int version;
    private String note;
    private boolean status;
    private Date modifiedDate;
    
    public Date getModifiedDate() {
        return modifiedDate;
    }

    public void setModifiedDate(Date modifiedDate) {
        this.modifiedDate = modifiedDate;
    }
    @ManyToOne
    @JoinColumn(name = "authorId")
    private Author author;
    @ManyToOne
    @JoinColumn(name = "langId")
    private Languages language;
    @ManyToOne
    @JoinColumn(name = "storeId")
    private Store store;
    @ManyToOne
    @JoinColumn(name = "ownerItemid")
    private OwnerItem ownerItem;
    @ManyToOne
    @JoinColumn(name = "statusOfUseId")
    private StatusOfUse statusOfUse;
    @ManyToOne
    @JoinColumn(name = "typeOfUseId")
    private TypeOfUse typeOfUse;
    @ManyToOne
    @JoinColumn(name = "typeOfRegulationId")
    private TypeOfRegulation typeOfRegulation;

    public Item() {
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public TypeOfRegulation getTypeOfRegulation() {
        return typeOfRegulation;
    }

    public void setTypeOfRegulation(TypeOfRegulation typeOfRegulation) {
        this.typeOfRegulation = typeOfRegulation;
    }

    public TypeOfUse getTypeOfUse() {
        return typeOfUse;
    }

    public void setTypeOfUse(TypeOfUse typeOfUse) {
        this.typeOfUse = typeOfUse;
    }

    public StatusOfUse getStatusOfUse() {
        return statusOfUse;
    }

    public void setStatusOfUse(StatusOfUse statusOfUse) {
        this.statusOfUse = statusOfUse;
    }

    public OwnerItem getOwnerItem() {
        return ownerItem;
    }

    public void setOwnerItem(OwnerItem ownerItem) {
        this.ownerItem = ownerItem;
    }

    public Store getStore() {
        return store;
    }

    public void setStore(Store store) {
        this.store = store;
    }

    public Languages getLanguage() {
        return language;
    }

    public void setLanguage(Languages language) {
        this.language = language;
    }

    public Author getAuthor() {
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }

    public int getItemId() {
        return itemId;
    }

    public void setItemId(int itemId) {
        this.itemId = itemId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getOtherCode() {
        return otherCode;
    }

    public void setOtherCode(String otherCode) {
        this.otherCode = otherCode;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }
}
